home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / gg / ncurses-5.3.lha / ncurses-5.3 / Ada95 / gen / terminal_interface-curses.ads.m < prev   
Text File  |  2002-10-24  |  53KB  |  1,558 lines

  1. --  -*- ada -*-
  2. define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl
  3. include(M4MACRO)------------------------------------------------------------------------------
  4. --                                                                          --
  5. --                           GNAT ncurses Binding                           --
  6. --                                                                          --
  7. --                         Terminal_Interface.Curses                        --
  8. --                                                                          --
  9. --                                 S P E C                                  --
  10. --                                                                          --
  11. ------------------------------------------------------------------------------
  12. -- Copyright (c) 1998 Free Software Foundation, Inc.                        --
  13. --                                                                          --
  14. -- Permission is hereby granted, free of charge, to any person obtaining a  --
  15. -- copy of this software and associated documentation files (the            --
  16. -- "Software"), to deal in the Software without restriction, including      --
  17. -- without limitation the rights to use, copy, modify, merge, publish,      --
  18. -- distribute, distribute with modifications, sublicense, and/or sell       --
  19. -- copies of the Software, and to permit persons to whom the Software is    --
  20. -- furnished to do so, subject to the following conditions:                 --
  21. --                                                                          --
  22. -- The above copyright notice and this permission notice shall be included  --
  23. -- in all copies or substantial portions of the Software.                   --
  24. --                                                                          --
  25. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
  26. -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
  27. -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
  28. -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
  29. -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
  30. -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
  31. -- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
  32. --                                                                          --
  33. -- Except as contained in this notice, the name(s) of the above copyright   --
  34. -- holders shall not be used in advertising or otherwise to promote the     --
  35. -- sale, use or other dealings in this Software without prior written       --
  36. -- authorization.                                                           --
  37. ------------------------------------------------------------------------------
  38. --  Author:  Juergen Pfeifer, 1996
  39. --  Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en
  40. --  Version Control:
  41. --  $Revision: 1.30 $
  42. --  Binding Version 01.00
  43. ------------------------------------------------------------------------------
  44. include(`Base_Defs')
  45. with System.Storage_Elements;
  46. with Interfaces.C;   --  We need this for some assertions.
  47.  
  48. package Terminal_Interface.Curses is
  49.    pragma Preelaborate (Terminal_Interface.Curses);
  50. include(`Linker_Options')
  51. include(`Version_Info')
  52.    type Window is private;
  53.    Null_Window : constant Window;
  54.  
  55.    type Line_Position   is new Natural; --  line coordinate
  56.    type Column_Position is new Natural; --  column coordinate
  57.  
  58.    subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
  59.    --  Type to count lines. We do not allow null windows, so must be positive
  60.    subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
  61.    --  Type to count columns. We do not allow null windows, so must be positive
  62.  
  63.    type Key_Code is new Natural;
  64.    --  That is anything including real characters, special keys and logical
  65.    --  request codes.
  66.  
  67.    subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX;
  68.    --  This are the codes that potentially represent a real keystroke.
  69.    --  Not all codes may be possible on a specific terminal. To check the
  70.    --  availability of a special key, the Has_Key function is provided.
  71.  
  72.    subtype Special_Key_Code is Real_Key_Code
  73.      range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
  74.    --  Type for a function- or special key number
  75.  
  76.    subtype Normal_Key_Code is Real_Key_Code range
  77.      Character'Pos (Character'First) .. Character'Pos (Character'Last);
  78.    --  This are the codes for regular (incl. non-graphical) characters.
  79.  
  80.    --  Constants for function- and special keys
  81.    --
  82.    Key_None                       : constant Special_Key_Code := M4_SPECIAL_FIRST;
  83. include(`Key_Definitions')
  84.    Key_Max                        : constant Special_Key_Code
  85.      := Special_Key_Code'Last;
  86.  
  87.    subtype User_Key_Code is Key_Code
  88.      range (Key_Max + 129) .. Key_Code'Last;
  89.    --  This is reserved for user defined key codes. The range between Key_Max
  90.    --  and the first user code is reserved for subsystems like menu and forms.
  91.  
  92.    --  For those who like to use the original key names we produce them were
  93.    --  they differ from the original. Please note that they may differ in
  94.    --  lower/upper case.
  95. include(`Old_Keys')dnl
  96.  
  97. ------------------------------------------------------------------------------
  98.  
  99.    type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
  100.    for Color_Number'Size use Interfaces.C.short'Size;
  101.    --  (n)curses uses a short for the color index
  102.    --  The model is, that a Color_Number is an index into an array of
  103.    --  (potentially) definable colors. Some of those indices are
  104.    --  predefined (see below), although they may not really exist.
  105.  
  106. include(`Color_Defs')
  107.    type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
  108.    for RGB_Value'Size use Interfaces.C.short'Size;
  109.    --  Some system may allow to redefine a color by setting RGB values.
  110.  
  111.    type Color_Pair is range 0 .. 255;
  112.    for Color_Pair'Size use 8;
  113.    subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
  114.    --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
  115.    --  is fixed (Black & White). A color pair is simply a combination of
  116.    --  two colors described by Color_Numbers, one for the foreground and
  117.    --  the other for the background
  118.  
  119. include(`Character_Attribute_Set_Rep')
  120.    --  (n)curses uses all but the lowest 16 Bits for Attributes.
  121.  
  122.    Normal_Video : constant Character_Attribute_Set := (others => False);
  123.  
  124.    type Attributed_Character is
  125.       record
  126.          Attr  : Character_Attribute_Set;
  127.          Color : Color_Pair;
  128.          Ch    : Character;
  129.       end record;
  130.    pragma Convention (C, Attributed_Character);
  131.    --  This is the counterpart for the chtype in C.
  132.  
  133. include(`AC_Rep')
  134.    Default_Character : constant Attributed_Character
  135.      := (Ch    => Character'First,
  136.          Color => Color_Pair'First,
  137.          Attr  => (others => False));  --  preelaboratable Normal_Video
  138.  
  139.    type Attributed_String is array (Positive range <>) of Attributed_Character;
  140.    pragma Pack (Attributed_String);
  141.    --  In this binding we allow strings of attributed characters.
  142.  
  143.    ------------------
  144.    --  Exceptions  --
  145.    ------------------
  146.    Curses_Exception     : exception;
  147.    Wrong_Curses_Version : exception;
  148.  
  149.    --  Those exceptions are raised by the ETI (Extended Terminal Interface)
  150.    --  subpackets for Menu and Forms handling.
  151.    --
  152.    Eti_System_Error    : exception;
  153.    Eti_Bad_Argument    : exception;
  154.    Eti_Posted          : exception;
  155.    Eti_Connected       : exception;
  156.    Eti_Bad_State       : exception;
  157.    Eti_No_Room         : exception;
  158.    Eti_Not_Posted      : exception;
  159.    Eti_Unknown_Command : exception;
  160.    Eti_No_Match        : exception;
  161.    Eti_Not_Selectable  : exception;
  162.    Eti_Not_Connected   : exception;
  163.    Eti_Request_Denied  : exception;
  164.    Eti_Invalid_Field   : exception;
  165.    Eti_Current         : exception;
  166.  
  167.    --------------------------------------------------------------------------
  168.    --  External C variables
  169.    --  Conceptually even in C this are kind of constants, but they are
  170.    --  initialized and sometimes changed by the library routines at runtime
  171.    --  depending on the type of terminal. I believe the best way to model
  172.    --  this is to use functions.
  173.    --------------------------------------------------------------------------
  174.  
  175.    function Lines            return Line_Count;
  176.    pragma Inline (Lines);
  177.  
  178.    function Columns          return Column_Count;
  179.    pragma Inline (Columns);
  180.  
  181.    function Tab_Size         return Natural;
  182.    pragma Inline (Tab_Size);
  183.  
  184.    function Number_Of_Colors return Natural;
  185.    pragma Inline (Number_Of_Colors);
  186.  
  187.    function Number_Of_Color_Pairs return Natural;
  188.    pragma Inline (Number_Of_Color_Pairs);
  189.  
  190.    ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
  191.      Attributed_Character;
  192.    pragma Import (C, ACS_Map, "acs_map");
  193.    --
  194.    --
  195.    --  Constants for several characters from the Alternate Character Set
  196.    --  You must use this constants as indices into the ACS_Map array
  197.    --  to get the corresponding attributed character at runtime.
  198.    --
  199. include(`ACS_Map')dnl
  200.  
  201.    --  MANPAGE(`curs_initscr.3x')
  202.    --  | Not implemented: newterm, set_term, delscreen, curscr
  203.  
  204.    --  ANCHOR(`stdscr',`Standard_Window')
  205.    function Standard_Window return Window;
  206.    --  AKA
  207.    pragma Inline (Standard_Window);
  208.  
  209.    --  ANCHOR(`initscr()',`Init_Screen')
  210.    procedure Init_Screen;
  211.  
  212.    --  ANCHOR(`initscr()',`Init_Windows')
  213.    procedure Init_Windows renames Init_Screen;
  214.    --  AKA
  215.    pragma Inline (Init_Screen);
  216.    pragma Inline (Init_Windows);
  217.  
  218.    --  ANCHOR(`endwin()',`End_Windows')
  219.    procedure End_Windows;
  220.    --  AKA
  221.    procedure End_Screen renames End_Windows;
  222.    pragma Inline (End_Windows);
  223.    pragma Inline (End_Screen);
  224.  
  225.    --  ANCHOR(`isendwin()',`Is_End_Window')
  226.    function Is_End_Window return Boolean;
  227.    --  AKA
  228.    pragma Inline (Is_End_Window);
  229.  
  230.    --  MANPAGE(`curs_move.3x')
  231.  
  232.    --  ANCHOR(`wmove()',`Move_Cursor')
  233.    procedure Move_Cursor (Win    : in Window := Standard_Window;
  234.                           Line   : in Line_Position;
  235.                           Column : in Column_Position);
  236.    --  AKA
  237.    --  ALIAS(`move()')
  238.    pragma Inline (Move_Cursor);
  239.  
  240.    --  MANPAGE(`curs_addch.3x')
  241.  
  242.    --  ANCHOR(`waddch()',`Add')
  243.    procedure Add (Win :  in Window := Standard_Window;
  244.                   Ch  :  in Attributed_Character);
  245.    --  AKA
  246.    --  ALIAS(`addch()')
  247.  
  248.    procedure Add (Win :  in Window := Standard_Window;
  249.                   Ch  :  in Character);
  250.    --  Add a single character at the current logical cursor position to
  251.    --  the window. Use the current windows attributes.
  252.  
  253.    --  ANCHOR(`mvwaddch()',`Add')
  254.    procedure Add
  255.      (Win    : in Window := Standard_Window;
  256.       Line   : in Line_Position;
  257.       Column : in Column_Position;
  258.       Ch     : in Attributed_Character);
  259.    --  AKA
  260.    --  ALIAS(`mvaddch()')
  261.  
  262.    procedure Add
  263.      (Win    : in Window := Standard_Window;
  264.       Line   : in Line_Position;
  265.       Column : in Column_Position;
  266.       Ch     : in Character);
  267.    --  Move to the position and add a single character into the window
  268.    --  There are more Add routines, so the Inline pragma follows later
  269.  
  270.    --  ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
  271.    procedure Add_With_Immediate_Echo
  272.      (Win : in Window := Standard_Window;
  273.       Ch  : in Attributed_Character);
  274.    --  AKA
  275.    --  ALIAS(`echochar()')
  276.  
  277.    procedure Add_With_Immediate_Echo
  278.      (Win : in Window := Standard_Window;
  279.       Ch  : in Character);
  280.    --  Add a character and do an immediate refresh of the screen.
  281.    pragma Inline (Add_With_Immediate_Echo);
  282.  
  283.    --  MANPAGE(`curs_window.3x')
  284.    --  Not Implemented: wcursyncup
  285.  
  286.    --  ANCHOR(`newwin()',`Create')
  287.    function Create
  288.      (Number_Of_Lines       : Line_Count;
  289.       Number_Of_Columns     : Column_Count;
  290.       First_Line_Position   : Line_Position;
  291.       First_Column_Position : Column_Position) return Window;
  292.    --  Not Implemented: Default Number_Of_Lines, Number_Of_Columns
  293.    --  the C version lets them be 0, see the man page.
  294.    --  AKA
  295.    pragma Inline (Create);
  296.  
  297.    function New_Window
  298.      (Number_Of_Lines       : Line_Count;
  299.       Number_Of_Columns     : Column_Count;
  300.       First_Line_Position   : Line_Position;
  301.       First_Column_Position : Column_Position) return Window
  302.      renames Create;
  303.    pragma Inline (New_Window);
  304.  
  305.    --  ANCHOR(`delwin()',`Delete')
  306.    procedure Delete (Win : in out Window);
  307.    --  AKA
  308.    --  Reset Win to Null_Window
  309.    pragma Inline (Delete);
  310.  
  311.    --  ANCHOR(`subwin()',`Sub_Window')
  312.    function Sub_Window
  313.      (Win                   : Window := Standard_Window;
  314.       Number_Of_Lines       : Line_Count;
  315.       Number_Of_Columns     : Column_Count;
  316.       First_Line_Position   : Line_Position;
  317.       First_Column_Position : Column_Position) return Window;
  318.    --  AKA
  319.    pragma Inline (Sub_Window);
  320.  
  321.    --  ANCHOR(`derwin()',`Derived_Window')
  322.    function Derived_Window
  323.      (Win                   : Window := Standard_Window;
  324.       Number_Of_Lines       : Line_Count;
  325.       Number_Of_Columns     : Column_Count;
  326.       First_Line_Position   : Line_Position;
  327.       First_Column_Position : Column_Position) return Window;
  328.    --  AKA
  329.    pragma Inline (Derived_Window);
  330.  
  331.    --  ANCHOR(`dupwin()',`Duplicate')
  332.    function Duplicate (Win : Window) return Window;
  333.    --  AKA
  334.    pragma Inline (Duplicate);
  335.  
  336.    --  ANCHOR(`mvwin()',`Move_Window')
  337.    procedure Move_Window (Win    : in Window;
  338.                           Line   : in Line_Position;
  339.                           Column : in Column_Position);
  340.    --  AKA
  341.    pragma Inline (Move_Window);
  342.  
  343.    --  ANCHOR(`mvderwin()',`Move_Derived_Window')
  344.    procedure Move_Derived_Window (Win    : in Window;
  345.                                   Line   : in Line_Position;
  346.                                   Column : in Column_Position);
  347.    --  AKA
  348.    pragma Inline (Move_Derived_Window);
  349.  
  350.    --  ANCHOR(`wsyncup()',`Synchronize_Upwards')
  351.    procedure Synchronize_Upwards (Win : in Window);
  352.    --  AKA
  353.    pragma Import (C, Synchronize_Upwards, "wsyncup");
  354.  
  355.    --  ANCHOR(`wsyncdown()',`Synchronize_Downwards')
  356.    procedure Synchronize_Downwards (Win : in Window);
  357.    --  AKA
  358.    pragma Import (C, Synchronize_Downwards, "wsyncdown");
  359.  
  360.    --  ANCHOR(`syncok()',`Set_Synch_Mode')
  361.    procedure Set_Synch_Mode (Win  : in Window := Standard_Window;
  362.                              Mode : in Boolean := False);
  363.    --  AKA
  364.    pragma Inline (Set_Synch_Mode);
  365.  
  366.    --  MANPAGE(`curs_addstr.3x')
  367.  
  368.    --  ANCHOR(`waddnstr()',`Add')
  369.    procedure Add (Win : in Window := Standard_Window;
  370.                   Str : in String;
  371.                   Len : in Integer := -1);
  372.    --  AKA
  373.    --  ALIAS(`waddstr()')
  374.    --  ALIAS(`addnstr()')
  375.    --  ALIAS(`addstr()')
  376.  
  377.    --  ANCHOR(`mvwaddnstr()',`Add')
  378.    procedure Add (Win    : in Window := Standard_Window;
  379.                   Line   : in Line_Position;
  380.                   Column : in Column_Position;
  381.                   Str    : in String;
  382.                   Len    : in Integer := -1);
  383.    --  AKA
  384.    --  ALIAS(`mvwaddstr()')
  385.    --  ALIAS(`mvaddnstr()')
  386.    --  ALIAS(`mvaddstr()')
  387.  
  388.    --  MANPAGE(`curs_addchstr.3x')
  389.  
  390.    --  ANCHOR(`waddchnstr()',`Add')
  391.    procedure Add (Win : in Window := Standard_Window;
  392.                   Str : in Attributed_String;
  393.                   Len : in Integer := -1);
  394.    --  AKA
  395.    --  ALIAS(`waddchstr()')
  396.    --  ALIAS(`addchnstr()')
  397.    --  ALIAS(`addchstr()')
  398.  
  399.    --  ANCHOR(`mvwaddchnstr()',`Add')
  400.    procedure Add (Win    : in Window := Standard_Window;
  401.                   Line   : in Line_Position;
  402.                   Column : in Column_Position;
  403.                   Str    : in Attributed_String;
  404.                   Len    : in Integer := -1);
  405.    --  AKA
  406.    --  ALIAS(`mvwaddchstr()')
  407.    --  ALIAS(`mvaddchnstr()')
  408.    --  ALIAS(`mvaddchstr()')
  409.    pragma Inline (Add);
  410.  
  411.    --  MANPAGE(`curs_border.3x')
  412.    --  | Not implemented: mvhline,  mvwhline, mvvline, mvwvline
  413.    --  | use Move_Cursor then Horizontal_Line or Vertical_Line
  414.  
  415.    --  ANCHOR(`wborder()',`Border')
  416.    procedure Border
  417.      (Win                       : in Window := Standard_Window;
  418.       Left_Side_Symbol          : in Attributed_Character := Default_Character;
  419.       Right_Side_Symbol         : in Attributed_Character := Default_Character;
  420.       Top_Side_Symbol           : in Attributed_Character := Default_Character;
  421.       Bottom_Side_Symbol        : in Attributed_Character := Default_Character;
  422.       Upper_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
  423.       Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
  424.       Lower_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
  425.       Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
  426.      );
  427.    --  AKA
  428.    --  ALIAS(`border()')
  429.    pragma Inline (Border);
  430.  
  431.    --  ANCHOR(`box()',`Box')
  432.    procedure Box
  433.      (Win               : in Window := Standard_Window;
  434.       Vertical_Symbol   : in Attributed_Character := Default_Character;
  435.       Horizontal_Symbol : in Attributed_Character := Default_Character);
  436.    --  AKA
  437.    pragma Inline (Box);
  438.  
  439.    --  ANCHOR(`whline()',`Horizontal_Line')
  440.    procedure Horizontal_Line
  441.      (Win         : in Window := Standard_Window;
  442.       Line_Size   : in Natural;
  443.       Line_Symbol : in Attributed_Character := Default_Character);
  444.    --  AKA
  445.    --  ALIAS(`hline()')
  446.    pragma Inline (Horizontal_Line);
  447.  
  448.    --  ANCHOR(`wvline()',`Vertical_Line')
  449.    procedure Vertical_Line
  450.      (Win         : in Window := Standard_Window;
  451.       Line_Size   : in Natural;
  452.       Line_Symbol : in Attributed_Character := Default_Character);
  453.    --  AKA
  454.    --  ALIAS(`vline()')
  455.    pragma Inline (Vertical_Line);
  456.  
  457.    --  MANPAGE(`curs_getch.3x')
  458.    --  Not implemented: mvgetch, mvwgetch
  459.  
  460.    --  ANCHOR(`wgetch()',`Get_Keystroke')
  461.    function Get_Keystroke (Win : Window := Standard_Window)
  462.                            return Real_Key_Code;
  463.    --  AKA
  464.    --  ALIAS(`getch()')
  465.    --  Get a character from the keyboard and echo it - if enabled - to the
  466.    --  window.
  467.    --  If for any reason (i.e. a timeout) we couldn't get a character the
  468.    --  returned keycode is Key_None.
  469.    pragma Inline (Get_Keystroke);
  470.  
  471.    --  ANCHOR(`ungetch()',`Undo_Keystroke')
  472.    procedure Undo_Keystroke (Key : in Real_Key_Code);
  473.    --  AKA
  474.    pragma Inline (Undo_Keystroke);
  475.  
  476.    --  ANCHOR(`has_key()',`Has_Key')
  477.    function Has_Key (Key : Special_Key_Code) return Boolean;
  478.    --  AKA
  479.    pragma Inline (Has_Key);
  480.  
  481.    --  |
  482.    --  | Some helper functions
  483.    --  |
  484.    function Is_Function_Key (Key : Special_Key_Code) return Boolean;
  485.    --  Return True if the Key is a function key (i.e. one of F0 .. F63)
  486.    pragma Inline (Is_Function_Key);
  487.  
  488.    subtype Function_Key_Number is Integer range 0 .. 63;
  489.    --  (n)curses allows for 64 function keys.
  490.  
  491.    function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
  492.    --  Return the number of the function key. If the code is not a
  493.    --  function key, a CONSTRAINT_ERROR will be raised.
  494.    pragma Inline (Function_Key);
  495.  
  496.    function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
  497.    --  Return the key code for a given function-key number.
  498.    pragma Inline (Function_Key_Code);
  499.  
  500.    --  MANPAGE(`curs_attr.3x')
  501.    --  | Not implemented attr_off,  wattr_off,
  502.    --  |  attr_on, wattr_on, attr_set, wattr_set
  503.  
  504.    --  PAIR_NUMBER
  505.    --  PAIR_NUMBER(c) is the same as c.Color
  506.  
  507.    --  ANCHOR(`standout()',`Standout')
  508.    procedure Standout (Win : Window  := Standard_Window;
  509.                        On  : Boolean := True);
  510.    --  ALIAS(`wstandout()')
  511.    --  ALIAS(`wstandend()')
  512.  
  513.    --  ANCHOR(`wattron()',`Switch_Character_Attribute')
  514.    procedure Switch_Character_Attribute
  515.      (Win  : in Window := Standard_Window;
  516.       Attr : in Character_Attribute_Set := Normal_Video;
  517.       On   : in Boolean := True); --  if False we switch Off.
  518.    --  Switches those Attributes set to true in the list.
  519.    --  AKA
  520.    --  ALIAS(`wattroff()')
  521.    --  ALIAS(`attron()')
  522.    --  ALIAS(`attroff()')
  523.  
  524.    --  ANCHOR(`wattrset()',`Set_Character_Attributes')
  525.    procedure Set_Character_Attributes
  526.      (Win   : in Window := Standard_Window;
  527.       Attr  : in Character_Attribute_Set := Normal_Video;
  528.       Color : in Color_Pair := Color_Pair'First);
  529.    --  AKA
  530.    --  ALIAS(`attrset()')
  531.    pragma Inline (Set_Character_Attributes);
  532.  
  533.    --  ANCHOR(`wattr_get()',`Get_Character_Attributes')
  534.    function Get_Character_Attribute
  535.      (Win : in Window := Standard_Window) return Character_Attribute_Set;
  536.    --  AKA
  537.    --  ALIAS(`attr_get()')
  538.  
  539.    --  ANCHOR(`wattr_get()',`Get_Character_Attribute')
  540.    function Get_Character_Attribute
  541.      (Win : in Window := Standard_Window) return Color_Pair;
  542.    --  AKA
  543.    pragma Inline (Get_Character_Attribute);
  544.  
  545.    --  ANCHOR(`wcolor_set()',`Set_Color')
  546.    procedure Set_Color (Win  : in Window := Standard_Window;
  547.                         Pair : in Color_Pair);
  548.    --  AKA
  549.    --  ALIAS(`color_set()')
  550.    pragma Inline (Set_Color);
  551.  
  552.    --  ANCHOR(`wchgat()',`Change_Attributes')
  553.    procedure Change_Attributes
  554.      (Win   : in Window := Standard_Window;
  555.       Count : in Integer := -1;
  556.       Attr  : in Character_Attribute_Set := Normal_Video;
  557.       Color : in Color_Pair := Color_Pair'First);
  558.    --  AKA
  559.    --  ALIAS(`chgat()')
  560.  
  561.    --  ANCHOR(`mvwchgat()',`Change_Attributes')
  562.    procedure Change_Attributes
  563.      (Win    : in Window := Standard_Window;
  564.       Line   : in Line_Position := Line_Position'First;
  565.       Column : in Column_Position := Column_Position'First;
  566.       Count  : in Integer := -1;
  567.       Attr   : in Character_Attribute_Set := Normal_Video;
  568.       Color  : in Color_Pair := Color_Pair'First);
  569.    --  AKA
  570.    --  ALIAS(`mvchgat()')
  571.    pragma Inline (Change_Attributes);
  572.  
  573.    --  MANPAGE(`curs_beep.3x')
  574.  
  575.    --  ANCHOR(`beep()',`Beep')
  576.    procedure Beep;
  577.    --  AKA
  578.    pragma Inline (Beep);
  579.  
  580.    --  ANCHOR(`flash()',`Flash_Screen')
  581.    procedure Flash_Screen;
  582.    --  AKA
  583.    pragma Inline (Flash_Screen);
  584.  
  585.    --  MANPAGE(`curs_inopts.3x')
  586.  
  587.    --  | Not implemented : typeahead
  588.    --
  589.    --  ANCHOR(`cbreak()',`Set_Cbreak_Mode')
  590.    procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
  591.    --  AKA
  592.    --  ALIAS(`nocbreak()')
  593.    pragma Inline (Set_Cbreak_Mode);
  594.  
  595.    --  ANCHOR(`raw()',`Set_Raw_Mode')
  596.    procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
  597.    --  AKA
  598.    --  ALIAS(`noraw()')
  599.    pragma Inline (Set_Raw_Mode);
  600.  
  601.    --  ANCHOR(`echo()',`Set_Echo_Mode')
  602.    procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
  603.    --  AKA
  604.    --  ALIAS(`noecho()')
  605.    pragma Inline (Set_Echo_Mode);
  606.  
  607.    --  ANCHOR(`meta()',`Set_Meta_Mode')
  608.    procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
  609.                             SwitchOn : in Boolean := True);
  610.    --  AKA
  611.    pragma Inline (Set_Meta_Mode);
  612.  
  613.    --  ANCHOR(`keypad()',`Set_KeyPad_Mode')
  614.    procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
  615.                               SwitchOn : in Boolean := True);
  616.    --  AKA
  617.    pragma Inline (Set_KeyPad_Mode);
  618.  
  619.    function Get_KeyPad_Mode (Win : in Window := Standard_Window)
  620.                              return Boolean;
  621.    --  This has no pendant in C. There you've to look into the WINDOWS
  622.    --  structure to get the value. Bad practice, not repeated in Ada.
  623.  
  624.    type Half_Delay_Amount is range 1 .. 255;
  625.  
  626.    --  ANCHOR(`halfdelay()',`Half_Delay')
  627.    procedure Half_Delay (Amount : in Half_Delay_Amount);
  628.    --  AKA
  629.    pragma Inline (Half_Delay);
  630.  
  631.    --  ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
  632.    procedure Set_Flush_On_Interrupt_Mode
  633.      (Win  : in Window := Standard_Window;
  634.       Mode : in Boolean := True);
  635.    --  AKA
  636.    pragma Inline (Set_Flush_On_Interrupt_Mode);
  637.  
  638.    --  ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
  639.    procedure Set_Queue_Interrupt_Mode
  640.      (Win   : in Window := Standard_Window;
  641.       Flush : in Boolean := True);
  642.    --  AKA
  643.    --  ALIAS(`noqiflush()')
  644.    pragma Inline (Set_Queue_Interrupt_Mode);
  645.  
  646.    --  ANCHOR(`nodelay()',`Set_NoDelay_Mode')
  647.    procedure Set_NoDelay_Mode
  648.      (Win  : in Window := Standard_Window;
  649.       Mode : in Boolean := False);
  650.    --  AKA
  651.    pragma Inline (Set_NoDelay_Mode);
  652.  
  653.    type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
  654.  
  655.    --  ANCHOR(`wtimeout()',`Set_Timeout_Mode')
  656.    procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
  657.                                Mode   : in Timeout_Mode;
  658.                                Amount : in Natural); --  in Milliseconds
  659.    --  AKA
  660.    --  ALIAS(`timeout()')
  661.    --  Instead of overloading the semantic of the sign of amount, we
  662.    --  introduce the Timeout_Mode parameter. This should improve
  663.    --  readability. For Blocking and Non_Blocking, the Amount is not
  664.    --  evaluated.
  665.    --  We don't inline this procedure.
  666.  
  667.    --  ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
  668.    procedure Set_Escape_Timer_Mode
  669.      (Win       : in Window := Standard_Window;
  670.       Timer_Off : in Boolean := False);
  671.    --  AKA
  672.    pragma Inline (Set_Escape_Timer_Mode);
  673.  
  674.    --  MANPAGE(`curs_outopts.3x')
  675.  
  676.    --  ANCHOR(`nl()',`Set_NL_Mode')
  677.    procedure Set_NL_Mode (SwitchOn : in Boolean := True);
  678.    --  AKA
  679.    --  ALIAS(`nonl()')
  680.    pragma Inline (Set_NL_Mode);
  681.  
  682.    --  ANCHOR(`clearok()',`Clear_On_Next_Update')
  683.    procedure Clear_On_Next_Update
  684.      (Win      : in Window := Standard_Window;
  685.       Do_Clear : in Boolean := True);
  686.    --  AKA
  687.    pragma Inline (Clear_On_Next_Update);
  688.  
  689.    --  ANCHOR(`idlok()',`Use_Insert_Delete_Line')
  690.    procedure Use_Insert_Delete_Line
  691.      (Win    : in Window := Standard_Window;
  692.       Do_Idl : in Boolean := True);
  693.    --  AKA
  694.    pragma Inline (Use_Insert_Delete_Line);
  695.  
  696.    --  ANCHOR(`idcok()',`Use_Insert_Delete_Character')
  697.    procedure Use_Insert_Delete_Character
  698.      (Win    : in Window := Standard_Window;
  699.       Do_Idc : in Boolean := True);
  700.    --  AKA
  701.    pragma Inline (Use_Insert_Delete_Character);
  702.  
  703.    --  ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
  704.    procedure Leave_Cursor_After_Update
  705.      (Win      : in Window := Standard_Window;
  706.       Do_Leave : in Boolean := True);
  707.    --  AKA
  708.    pragma Inline (Leave_Cursor_After_Update);
  709.  
  710.    --  ANCHOR(`immedok()',`Immediate_Update_Mode')
  711.    procedure Immediate_Update_Mode
  712.      (Win  : in Window := Standard_Window;
  713.       Mode : in Boolean := False);
  714.    --  AKA
  715.    pragma Inline (Immediate_Update_Mode);
  716.  
  717.    --  ANCHOR(`scrollok()',`Allow_Scrolling')
  718.    procedure Allow_Scrolling
  719.      (Win  : in Window := Standard_Window;
  720.       Mode : in Boolean := False);
  721.    --  AKA
  722.    pragma Inline (Allow_Scrolling);
  723.  
  724.    function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
  725.    --  There is no such function in the C interface.
  726.    pragma Inline (Scrolling_Allowed);
  727.  
  728.    --  ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
  729.    procedure Set_Scroll_Region
  730.      (Win         : in Window := Standard_Window;
  731.       Top_Line    : in Line_Position;
  732.       Bottom_Line : in Line_Position);
  733.    --  AKA
  734.    --  ALIAS(`setscrreg()')
  735.    pragma Inline (Set_Scroll_Region);
  736.  
  737.    --  MANPAGE(`curs_refresh.3x')
  738.  
  739.    --  ANCHOR(`doupdate()',`Update_Screen')
  740.    procedure Update_Screen;
  741.    --  AKA
  742.    pragma Inline (Update_Screen);
  743.  
  744.    --  ANCHOR(`wrefresh()',`Refresh')
  745.    procedure Refresh (Win : in Window := Standard_Window);
  746.    --  AKA
  747.    --  There is an overloaded Refresh for Pads.
  748.    --  The Inline pragma appears there
  749.    --  ALIAS(`refresh()')
  750.  
  751.    --  ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
  752.    procedure Refresh_Without_Update
  753.      (Win : in Window := Standard_Window);
  754.    --  AKA
  755.    --  There is an overloaded Refresh_Without_Update for Pads.
  756.    --  The Inline pragma appears there
  757.  
  758.    --  ANCHOR(`redrawwin()',`Redraw')
  759.    procedure Redraw (Win : in Window := Standard_Window);
  760.    --  AKA
  761.  
  762.    --  ANCHOR(`wredrawln()',`Redraw')
  763.    procedure Redraw (Win        : in Window := Standard_Window;
  764.                      Begin_Line : in Line_Position;
  765.                      Line_Count : in Positive);
  766.    --  AKA
  767.    pragma Inline (Redraw);
  768.  
  769.    --  MANPAGE(`curs_clear.3x')
  770.  
  771.    --  ANCHOR(`werase()',`Erase')
  772.    procedure Erase (Win : in Window := Standard_Window);
  773.    --  AKA
  774.    --  ALIAS(`erase()')
  775.    pragma Inline (Erase);
  776.  
  777.    --  ANCHOR(`wclear()',`Clear')
  778.    procedure Clear
  779.      (Win : in Window := Standard_Window);
  780.    --  AKA
  781.    --  ALIAS(`clear()')
  782.    pragma Inline (Clear);
  783.  
  784.    --  ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
  785.    procedure Clear_To_End_Of_Screen
  786.      (Win : in Window := Standard_Window);
  787.    --  AKA
  788.    --  ALIAS(`clrtobot()')
  789.    pragma Inline (Clear_To_End_Of_Screen);
  790.  
  791.    --  ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
  792.    procedure Clear_To_End_Of_Line
  793.      (Win : in Window := Standard_Window);
  794.    --  AKA
  795.    --  ALIAS(`clrtoeol()')
  796.    pragma Inline (Clear_To_End_Of_Line);
  797.  
  798.    --  MANPAGE(`curs_bkgd.3x')
  799.  
  800.    --  ANCHOR(`wbkgdset()',`Set_Background')
  801.    --  TODO: we could have Set_Background(Window; Character_Attribute_Set)
  802.    --  because in C it is common to see bkgdset(A_BOLD) or
  803.    --  bkgdset(COLOR_PAIR(n))
  804.    procedure Set_Background
  805.      (Win : in Window := Standard_Window;
  806.       Ch  : in Attributed_Character);
  807.    --  AKA
  808.    --  ALIAS(`bkgdset()')
  809.    pragma Inline (Set_Background);
  810.  
  811.    --  ANCHOR(`wbkgd()',`Change_Background')
  812.    procedure Change_Background
  813.      (Win : in Window := Standard_Window;
  814.       Ch  : in Attributed_Character);
  815.    --  AKA
  816.    --  ALIAS(`bkgd()')
  817.    pragma Inline (Change_Background);
  818.  
  819.    --  ANCHOR(`wbkgdget()',`Get_Background')
  820.    --  ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
  821.    function Get_Background (Win : Window := Standard_Window)
  822.      return Attributed_Character;
  823.    --  AKA
  824.    --  ALIAS(`bkgdget()')
  825.    pragma Inline (Get_Background);
  826.  
  827.    --  MANPAGE(`curs_touch.3x')
  828.  
  829.    --  ANCHOR(`untouchwin()',`Untouch')
  830.    procedure Untouch (Win : in Window := Standard_Window);
  831.    --  AKA
  832.    pragma Inline (Untouch);
  833.  
  834.    --  ANCHOR(`touchwin()',`Touch')
  835.    procedure Touch (Win : in Window := Standard_Window);
  836.    --  AKA
  837.  
  838.    --  ANCHOR(`touchline()',`Touch')
  839.    procedure Touch (Win   : in Window := Standard_Window;
  840.                     Start : in Line_Position;
  841.                     Count : in Positive);
  842.    --  AKA
  843.    pragma Inline (Touch);
  844.  
  845.    --  ANCHOR(`wtouchln()',`Change_Line_Status')
  846.    procedure Change_Lines_Status (Win   : in Window := Standard_Window;
  847.                                   Start : in Line_Position;
  848.                                   Count : in Positive;
  849.                                   State : in Boolean);
  850.    --  AKA
  851.    pragma Inline (Change_Lines_Status);
  852.  
  853.    --  ANCHOR(`is_linetouched()',`Is_Touched')
  854.    function Is_Touched (Win  : Window := Standard_Window;
  855.                         Line : Line_Position) return Boolean;
  856.    --  AKA
  857.  
  858.    --  ANCHOR(`is_wintouched()',`Is_Touched')
  859.    function Is_Touched (Win : Window := Standard_Window) return Boolean;
  860.    --  AKA
  861.    pragma Inline (Is_Touched);
  862.  
  863.    --  MANPAGE(`curs_overlay.3x')
  864.  
  865.    --  ANCHOR(`copywin()',`Copy')
  866.    procedure Copy
  867.      (Source_Window            : in Window;
  868.       Destination_Window       : in Window;
  869.       Source_Top_Row           : in Line_Position;
  870.       Source_Left_Column       : in Column_Position;
  871.       Destination_Top_Row      : in Line_Position;
  872.       Destination_Left_Column  : in Column_Position;
  873.       Destination_Bottom_Row   : in Line_Position;
  874.       Destination_Right_Column : in Column_Position;
  875.       Non_Destructive_Mode     : in Boolean := True);
  876.    --  AKA
  877.    pragma Inline (Copy);
  878.  
  879.    --  ANCHOR(`overwrite()',`Overwrite')
  880.    procedure Overwrite (Source_Window      : in Window;
  881.                         Destination_Window : in Window);
  882.    --  AKA
  883.    pragma Inline (Overwrite);
  884.  
  885.    --  ANCHOR(`overlay()',`Overlay')
  886.    procedure Overlay (Source_Window      : in Window;
  887.                       Destination_Window : in Window);
  888.    --  AKA
  889.    pragma Inline (Overlay);
  890.  
  891.    --  MANPAGE(`curs_deleteln.3x')
  892.  
  893.    --  ANCHOR(`winsdelln()',`Insert_Delete_Lines')
  894.    procedure Insert_Delete_Lines
  895.      (Win   : in Window  := Standard_Window;
  896.       Lines : in Integer := 1); --  default is to insert one line above
  897.    --  AKA
  898.    --  ALIAS(`insdelln()')
  899.    pragma Inline (Insert_Delete_Lines);
  900.  
  901.    --  ANCHOR(`wdeleteln()',`Delete_Line')
  902.    procedure Delete_Line (Win : in Window := Standard_Window);
  903.    --  AKA
  904.    --  ALIAS(`deleteln()')
  905.    pragma Inline (Delete_Line);
  906.  
  907.    --  ANCHOR(`winsertln()',`Insert_Line')
  908.    procedure Insert_Line (Win : in Window := Standard_Window);
  909.    --  AKA
  910.    --  ALIAS(`insertln()')
  911.    pragma Inline (Insert_Line);
  912.  
  913.    --  MANPAGE(`curs_getyx.3x')
  914.  
  915.    --  ANCHOR(`getmaxyx()',`Get_Size')
  916.    procedure Get_Size
  917.      (Win               : in Window := Standard_Window;
  918.       Number_Of_Lines   : out Line_Count;
  919.       Number_Of_Columns : out Column_Count);
  920.    --  AKA
  921.    pragma Inline (Get_Size);
  922.  
  923.    --  ANCHOR(`getbegyx()',`Get_Window_Position')
  924.    procedure Get_Window_Position
  925.      (Win             : in Window := Standard_Window;
  926.       Top_Left_Line   : out Line_Position;
  927.       Top_Left_Column : out Column_Position);
  928.    --  AKA
  929.    pragma Inline (Get_Window_Position);
  930.  
  931.    --  ANCHOR(`getyx()',`Get_Cursor_Position')
  932.    procedure Get_Cursor_Position
  933.      (Win    : in  Window := Standard_Window;
  934.       Line   : out Line_Position;
  935.       Column : out Column_Position);
  936.    --  AKA
  937.    pragma Inline (Get_Cursor_Position);
  938.  
  939.    --  ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
  940.    procedure Get_Origin_Relative_To_Parent
  941.      (Win                : in  Window;
  942.       Top_Left_Line      : out Line_Position;
  943.       Top_Left_Column    : out Column_Position;
  944.       Is_Not_A_Subwindow : out Boolean);
  945.    --  AKA
  946.    --  Instead of placing -1 in the coordinates as return, we use a boolean
  947.    --  to return the info that the window has no parent.
  948.    pragma Inline (Get_Origin_Relative_To_Parent);
  949.  
  950.    --  MANPAGE(`curs_pad.3x')
  951.  
  952.    --  ANCHOR(`newpad()',`New_Pad')
  953.    function New_Pad (Lines   : Line_Count;
  954.                      Columns : Column_Count) return Window;
  955.    --  AKA
  956.    pragma Inline (New_Pad);
  957.  
  958.    --  ANCHOR(`subpad()',`Sub_Pad')
  959.    function Sub_Pad
  960.      (Pad                   : Window;
  961.       Number_Of_Lines       : Line_Count;
  962.       Number_Of_Columns     : Column_Count;
  963.       First_Line_Position   : Line_Position;
  964.       First_Column_Position : Column_Position) return Window;
  965.    --  AKA
  966.    pragma Inline (Sub_Pad);
  967.  
  968.    --  ANCHOR(`prefresh()',`Refresh')
  969.    procedure Refresh
  970.      (Pad                      : in Window;
  971.       Source_Top_Row           : in Line_Position;
  972.       Source_Left_Column       : in Column_Position;
  973.       Destination_Top_Row      : in Line_Position;
  974.       Destination_Left_Column  : in Column_Position;
  975.       Destination_Bottom_Row   : in Line_Position;
  976.       Destination_Right_Column : in Column_Position);
  977.    --  AKA
  978.    pragma Inline (Refresh);
  979.  
  980.    --  ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
  981.    procedure Refresh_Without_Update
  982.      (Pad                      : in Window;
  983.       Source_Top_Row           : in Line_Position;
  984.       Source_Left_Column       : in Column_Position;
  985.       Destination_Top_Row      : in Line_Position;
  986.       Destination_Left_Column  : in Column_Position;
  987.       Destination_Bottom_Row   : in Line_Position;
  988.       Destination_Right_Column : in Column_Position);
  989.    --  AKA
  990.    pragma Inline (Refresh_Without_Update);
  991.  
  992.    --  ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
  993.    procedure Add_Character_To_Pad_And_Echo_It
  994.      (Pad : in Window;
  995.       Ch  : in Attributed_Character);
  996.    --  AKA
  997.  
  998.    procedure Add_Character_To_Pad_And_Echo_It
  999.      (Pad : in Window;
  1000.       Ch  : in Character);
  1001.    pragma Inline (Add_Character_To_Pad_And_Echo_It);
  1002.  
  1003.    --  MANPAGE(`curs_scroll.3x')
  1004.  
  1005.    --  ANCHOR(`wscrl()',`Scroll')
  1006.    procedure Scroll (Win    : in Window  := Standard_Window;
  1007.                      Amount : in Integer := 1);
  1008.    --  AKA
  1009.    --  ALIAS(`scroll()')
  1010.    --  ALIAS(`scrl()')
  1011.    pragma Inline (Scroll);
  1012.  
  1013.    --  MANPAGE(`curs_delch.3x')
  1014.  
  1015.    --  ANCHOR(`wdelch()',`Delete_Character')
  1016.    procedure Delete_Character (Win : in Window := Standard_Window);
  1017.    --  AKA
  1018.    --  ALIAS(`delch()')
  1019.  
  1020.    --  ANCHOR(`mvwdelch()',`Delete_Character')
  1021.    procedure Delete_Character
  1022.      (Win    : in Window := Standard_Window;
  1023.       Line   : in Line_Position;
  1024.       Column : in Column_Position);
  1025.    --  AKA
  1026.    --  ALIAS(`mvdelch()')
  1027.    pragma Inline (Delete_Character);
  1028.  
  1029.    --  MANPAGE(`curs_inch.3x')
  1030.  
  1031.    --  ANCHOR(`winch()',`Peek')
  1032.    function Peek (Win : Window := Standard_Window)
  1033.      return Attributed_Character;
  1034.    --  ALIAS(`inch()')
  1035.    --  AKA
  1036.  
  1037.    --  ANCHOR(`mvwinch()',`Peek')
  1038.    function Peek
  1039.      (Win    : Window := Standard_Window;
  1040.       Line   : Line_Position;
  1041.       Column : Column_Position) return Attributed_Character;
  1042.    --  AKA
  1043.    --  ALIAS(`mvinch()')
  1044.    --  More Peek's follow, pragma Inline appears later.
  1045.  
  1046.    --  MANPAGE(`curs_insch.3x')
  1047.  
  1048.    --  ANCHOR(`winsch()',`Insert')
  1049.    procedure Insert (Win : in Window := Standard_Window;
  1050.                      Ch  : in Attributed_Character);
  1051.    --  AKA
  1052.    --  ALIAS(`insch()')
  1053.  
  1054.    --  ANCHOR(`mvwinsch()',`Insert')
  1055.    procedure Insert (Win    : in Window := Standard_Window;
  1056.                      Line   : in Line_Position;
  1057.                      Column : in Column_Position;
  1058.                      Ch     : in Attributed_Character);
  1059.    --  AKA
  1060.    --  ALIAS(`mvinsch()')
  1061.  
  1062.    --  MANPAGE(`curs_insstr.3x')
  1063.  
  1064.    --  ANCHOR(`winsnstr()',`Insert')
  1065.    procedure Insert (Win : in Window := Standard_Window;
  1066.                      Str : in String;
  1067.                      Len : in Integer := -1);
  1068.    --  AKA
  1069.    --  ALIAS(`winsstr()')
  1070.    --  ALIAS(`insnstr()')
  1071.    --  ALIAS(`insstr()')
  1072.  
  1073.    --  ANCHOR(`mvwinsnstr()',`Insert')
  1074.    procedure Insert (Win    : in Window := Standard_Window;
  1075.                      Line   : in Line_Position;
  1076.                      Column : in Column_Position;
  1077.                      Str    : in String;
  1078.                      Len    : in Integer := -1);
  1079.    --  AKA
  1080.    --  ALIAS(`mvwinsstr()')
  1081.    --  ALIAS(`mvinsnstr()')
  1082.    --  ALIAS(`mvinsstr()')
  1083.    pragma Inline (Insert);
  1084.  
  1085.    --  MANPAGE(`curs_instr.3x')
  1086.  
  1087.    --  ANCHOR(`winnstr()',`Peek')
  1088.    procedure Peek (Win : in  Window := Standard_Window;
  1089.                    Str : out String;
  1090.                    Len : in  Integer := -1);
  1091.    --  AKA
  1092.    --  ALIAS(`winstr()')
  1093.    --  ALIAS(`innstr()')
  1094.    --  ALIAS(`instr()')
  1095.  
  1096.    --  ANCHOR(`mvwinnstr()',`Peek')
  1097.    procedure Peek (Win    : in  Window := Standard_Window;
  1098.                    Line   : in  Line_Position;
  1099.                    Column : in  Column_Position;
  1100.                    Str    : out String;
  1101.                    Len    : in  Integer := -1);
  1102.    --  AKA
  1103.    --  ALIAS(`mvwinstr()')
  1104.    --  ALIAS(`mvinnstr()')
  1105.    --  ALIAS(`mvinstr()')
  1106.  
  1107.    --  MANPAGE(`curs_inchstr.3x')
  1108.  
  1109.    --  ANCHOR(`winchnstr()',`Peek')
  1110.    procedure Peek (Win : in  Window := Standard_Window;
  1111.                    Str : out Attributed_String;
  1112.                    Len : in  Integer := -1);
  1113.    --  AKA
  1114.    --  ALIAS(`winchstr()')
  1115.    --  ALIAS(`inchnstr()')
  1116.    --  ALIAS(`inchstr()')
  1117.  
  1118.    --  ANCHOR(`mvwinchnstr()',`Peek')
  1119.    procedure Peek (Win    : in  Window := Standard_Window;
  1120.                    Line   : in  Line_Position;
  1121.                    Column : in  Column_Position;
  1122.                    Str    : out Attributed_String;
  1123.                    Len    : in  Integer := -1);
  1124.    --  AKA
  1125.    --  ALIAS(`mvwinchstr()')
  1126.    --  ALIAS(`mvinchnstr()')
  1127.    --  ALIAS(`mvinchstr()')
  1128.    --  We don't inline the Peek procedures
  1129.  
  1130.    --  MANPAGE(`curs_getstr.3x')
  1131.  
  1132.    --  ANCHOR(`wgetnstr()',`Get')
  1133.    procedure Get (Win : in  Window := Standard_Window;
  1134.                   Str : out String;
  1135.                   Len : in  Integer := -1);
  1136.    --  AKA
  1137.    --  ALIAS(`wgetstr()')
  1138.    --  ALIAS(`getnstr()')
  1139.    --  ALIAS(`getstr()')
  1140.    --  actually getstr is not supported because that results in buffer
  1141.    --  overflows.
  1142.  
  1143.    --  ANCHOR(`mvwgetnstr()',`Get')
  1144.    procedure Get (Win    : in  Window := Standard_Window;
  1145.                   Line   : in  Line_Position;
  1146.                   Column : in  Column_Position;
  1147.                   Str    : out String;
  1148.                   Len    : in  Integer := -1);
  1149.    --  AKA
  1150.    --  ALIAS(`mvwgetstr()')
  1151.    --  ALIAS(`mvgetnstr()')
  1152.    --  ALIAS(`mvgetstr()')
  1153.    --  Get is not inlined
  1154.  
  1155.    --  MANPAGE(`curs_slk.3x')
  1156.  
  1157.    --  Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
  1158.  
  1159.    type Soft_Label_Key_Format is (Three_Two_Three,
  1160.                                   Four_Four,
  1161.                                   PC_Style,              --  ncurses specific
  1162.                                   PC_Style_With_Index);  --  "
  1163.    type Label_Number is new Positive range 1 .. 12;
  1164.    type Label_Justification is (Left, Centered, Right);
  1165.  
  1166.    --  ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
  1167.    procedure Init_Soft_Label_Keys
  1168.      (Format : in Soft_Label_Key_Format := Three_Two_Three);
  1169.    --  AKA
  1170.    pragma Inline (Init_Soft_Label_Keys);
  1171.  
  1172.    --  ANCHOR(`slk_set()',`Set_Soft_Label_Key')
  1173.    procedure Set_Soft_Label_Key (Label : in Label_Number;
  1174.                                  Text  : in String;
  1175.                                  Fmt   : in Label_Justification := Left);
  1176.    --  AKA
  1177.    --  We don't inline this procedure
  1178.  
  1179.    --  ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
  1180.    procedure Refresh_Soft_Label_Keys;
  1181.    --  AKA
  1182.    pragma Inline (Refresh_Soft_Label_Keys);
  1183.  
  1184.    --  ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
  1185.    procedure Refresh_Soft_Label_Keys_Without_Update;
  1186.    --  AKA
  1187.    pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
  1188.  
  1189.    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
  1190.    procedure Get_Soft_Label_Key (Label : in Label_Number;
  1191.                                  Text  : out String);
  1192.    --  AKA
  1193.  
  1194.    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
  1195.    function Get_Soft_Label_Key (Label : in Label_Number) return String;
  1196.    --  AKA
  1197.    --  Same as function
  1198.    pragma Inline (Get_Soft_Label_Key);
  1199.  
  1200.    --  ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
  1201.    procedure Clear_Soft_Label_Keys;
  1202.    --  AKA
  1203.    pragma Inline (Clear_Soft_Label_Keys);
  1204.  
  1205.    --  ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
  1206.    procedure Restore_Soft_Label_Keys;
  1207.    --  AKA
  1208.    pragma Inline (Restore_Soft_Label_Keys);
  1209.  
  1210.    --  ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
  1211.    procedure Touch_Soft_Label_Keys;
  1212.    --  AKA
  1213.    pragma Inline (Touch_Soft_Label_Keys);
  1214.  
  1215.    --  ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
  1216.    procedure Switch_Soft_Label_Key_Attributes
  1217.      (Attr : in Character_Attribute_Set;
  1218.       On   : in Boolean := True);
  1219.    --  AKA
  1220.    --  ALIAS(`slk_attroff()')
  1221.    pragma Inline (Switch_Soft_Label_Key_Attributes);
  1222.  
  1223.    --  ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
  1224.    procedure Set_Soft_Label_Key_Attributes
  1225.      (Attr  : in Character_Attribute_Set := Normal_Video;
  1226.       Color : in Color_Pair := Color_Pair'First);
  1227.    --  AKA
  1228.    pragma Inline (Set_Soft_Label_Key_Attributes);
  1229.  
  1230.    --  ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
  1231.    function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
  1232.    --  AKA
  1233.  
  1234.    --  ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
  1235.    function Get_Soft_Label_Key_Attributes return Color_Pair;
  1236.    --  AKA
  1237.    pragma Inline (Get_Soft_Label_Key_Attributes);
  1238.  
  1239.    --  ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
  1240.    procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
  1241.    --  AKA
  1242.    pragma Inline (Set_Soft_Label_Key_Color);
  1243.  
  1244.    --  MANPAGE(`keybound.3x')
  1245.    --  Not Implemented: keybound
  1246.  
  1247.    --  MANPAGE(`keyok.3x')
  1248.  
  1249.    --  ANCHOR(`keyok()',`Enable_Key')
  1250.    procedure Enable_Key (Key    : in Special_Key_Code;
  1251.                          Enable : in Boolean := True);
  1252.    --  AKA
  1253.    pragma Inline (Enable_Key);
  1254.  
  1255.    --  MANPAGE(`define_key.3x')
  1256.  
  1257.    --  ANCHOR(`define_key()',`Define_Key')
  1258.    procedure Define_Key (Definition : in String;
  1259.                          Key        : in Special_Key_Code);
  1260.    --  AKA
  1261.    pragma Inline (Define_Key);
  1262.  
  1263.    --  MANPAGE(`curs_util.3x')
  1264.  
  1265.    --  | Not implemented : filter, use_env
  1266.    --  | putwin, getwin are in the child package PutWin
  1267.    --
  1268.  
  1269.    --  ANCHOR(`keyname()',`Key_Name')
  1270.    procedure Key_Name (Key  : in  Real_Key_Code;
  1271.                        Name : out String);
  1272.    --  AKA
  1273.    --  The external name for a real keystroke.
  1274.  
  1275.    --  ANCHOR(`keyname()',`Key_Name')
  1276.    function Key_Name (Key  : in  Real_Key_Code) return String;
  1277.    --  AKA
  1278.    --  Same as function
  1279.    --  We don't inline this routine
  1280.  
  1281.    --  ANCHOR(`unctrl()',`Un_Control')
  1282.    procedure Un_Control (Ch  : in Attributed_Character;
  1283.                          Str : out String);
  1284.    --  AKA
  1285.  
  1286.    --  ANCHOR(`unctrl()',`Un_Control')
  1287.    function Un_Control (Ch  : in Attributed_Character) return String;
  1288.    --  AKA
  1289.    --  Same as function
  1290.    pragma Inline (Un_Control);
  1291.  
  1292.    --  ANCHOR(`delay_output()',`Delay_Output')
  1293.    procedure Delay_Output (Msecs : in Natural);
  1294.    --  AKA
  1295.    pragma Inline (Delay_Output);
  1296.  
  1297.    --  ANCHOR(`flushinp()',`Flush_Input')
  1298.    procedure Flush_Input;
  1299.    --  AKA
  1300.    pragma Inline (Flush_Input);
  1301.  
  1302.    --  MANPAGE(`curs_termattrs.3x')
  1303.  
  1304.    --  ANCHOR(`baudrate()',`Baudrate')
  1305.    function Baudrate return Natural;
  1306.    --  AKA
  1307.    pragma Inline (Baudrate);
  1308.  
  1309.    --  ANCHOR(`erasechar()',`Erase_Character')
  1310.    function Erase_Character return Character;
  1311.    --  AKA
  1312.    pragma Inline (Erase_Character);
  1313.  
  1314.    --  ANCHOR(`killchar()',`Kill_Character')
  1315.    function Kill_Character return Character;
  1316.    --  AKA
  1317.    pragma Inline (Kill_Character);
  1318.  
  1319.    --  ANCHOR(`has_ic()',`Has_Insert_Character')
  1320.    function Has_Insert_Character return Boolean;
  1321.    --  AKA
  1322.    pragma Inline (Has_Insert_Character);
  1323.  
  1324.    --  ANCHOR(`has_il()',`Has_Insert_Line')
  1325.    function Has_Insert_Line return Boolean;
  1326.    --  AKA
  1327.    pragma Inline (Has_Insert_Line);
  1328.  
  1329.    --  ANCHOR(`termattrs()',`Supported_Attributes')
  1330.    function Supported_Attributes return Character_Attribute_Set;
  1331.    --  AKA
  1332.    pragma Inline (Supported_Attributes);
  1333.  
  1334.    --  ANCHOR(`longname()',`Long_Name')
  1335.    procedure Long_Name (Name : out String);
  1336.    --  AKA
  1337.  
  1338.    --  ANCHOR(`longname()',`Long_Name')
  1339.    function Long_Name return String;
  1340.    --  AKA
  1341.    --  Same as function
  1342.    pragma Inline (Long_Name);
  1343.  
  1344.    --  ANCHOR(`termname()',`Terminal_Name')
  1345.    procedure Terminal_Name (Name : out String);
  1346.    --  AKA
  1347.  
  1348.    --  ANCHOR(`termname()',`Terminal_Name')
  1349.    function Terminal_Name return String;
  1350.    --  AKA
  1351.    --  Same as function
  1352.    pragma Inline (Terminal_Name);
  1353.  
  1354.    --  MANPAGE(`curs_color.3x')
  1355.  
  1356.    --  COLOR_PAIR
  1357.    --  COLOR_PAIR(n) in C is the same as
  1358.    --  Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
  1359.    --  In C you often see something like c = c | COLOR_PAIR(n);
  1360.    --  This is equivalent to c.Color := n;
  1361.  
  1362.    --  ANCHOR(`start_color()',`Start_Color')
  1363.    procedure Start_Color;
  1364.    --  AKA
  1365.    pragma Import (C, Start_Color, "start_color");
  1366.  
  1367.    --  ANCHOR(`init_pair()',`Init_Pair')
  1368.    procedure Init_Pair (Pair : in Redefinable_Color_Pair;
  1369.                         Fore : in Color_Number;
  1370.                         Back : in Color_Number);
  1371.    --  AKA
  1372.    pragma Inline (Init_Pair);
  1373.  
  1374.    --  ANCHOR(`pair_content()',`Pair_Content')
  1375.    procedure Pair_Content (Pair : in Color_Pair;
  1376.                            Fore : out Color_Number;
  1377.                            Back : out Color_Number);
  1378.    --  AKA
  1379.    pragma Inline (Pair_Content);
  1380.  
  1381.    --  ANCHOR(`has_colors()',`Has_Colors')
  1382.    function Has_Colors return Boolean;
  1383.    --  AKA
  1384.    pragma Inline (Has_Colors);
  1385.  
  1386.    --  ANCHOR(`init_color()',`Init_Color')
  1387.    procedure Init_Color (Color : in Color_Number;
  1388.                          Red   : in RGB_Value;
  1389.                          Green : in RGB_Value;
  1390.                          Blue  : in RGB_Value);
  1391.    --  AKA
  1392.    pragma Inline (Init_Color);
  1393.  
  1394.    --  ANCHOR(`can_change_color()',`Can_Change_Color')
  1395.    function Can_Change_Color return Boolean;
  1396.    --  AKA
  1397.    pragma Inline (Can_Change_Color);
  1398.  
  1399.    --  ANCHOR(`color_content()',`Color_Content')
  1400.    procedure Color_Content (Color : in  Color_Number;
  1401.                             Red   : out RGB_Value;
  1402.                             Green : out RGB_Value;
  1403.                             Blue  : out RGB_Value);
  1404.    --  AKA
  1405.    pragma Inline (Color_Content);
  1406.  
  1407.    --  MANPAGE(`curs_kernel.3x')
  1408.    --  | Not implemented: getsyx, setsyx
  1409.    --
  1410.    type Curses_Mode is (Curses, Shell);
  1411.  
  1412.    --  ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
  1413.    procedure Save_Curses_Mode (Mode : in Curses_Mode);
  1414.    --  AKA
  1415.    --  ALIAS(`def_shell_mode()')
  1416.    pragma Inline (Save_Curses_Mode);
  1417.  
  1418.    --  ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
  1419.    procedure Reset_Curses_Mode (Mode : in Curses_Mode);
  1420.    --  AKA
  1421.    --  ALIAS(`reset_shell_mode()')
  1422.    pragma Inline (Reset_Curses_Mode);
  1423.  
  1424.    --  ANCHOR(`savetty()',`Save_Terminal_State')
  1425.    procedure Save_Terminal_State;
  1426.    --  AKA
  1427.    pragma Inline (Save_Terminal_State);
  1428.  
  1429.    --  ANCHOR(`resetty();',`Reset_Terminal_State')
  1430.    procedure Reset_Terminal_State;
  1431.    --  AKA
  1432.    pragma Inline (Reset_Terminal_State);
  1433.  
  1434.    type Stdscr_Init_Proc is access
  1435.       function (Win     : Window;
  1436.                 Columns : Column_Count) return Integer;
  1437.    pragma Convention (C, Stdscr_Init_Proc);
  1438.    --  N.B.: the return value is actually ignored, but it seems to be
  1439.    --        a good practice to return 0 if you think all went fine
  1440.    --        and -1 otherwise.
  1441.  
  1442.    --  ANCHOR(`ripoffline()',`Rip_Off_Lines')
  1443.    procedure Rip_Off_Lines (Lines : in Integer;
  1444.                             Proc  : in Stdscr_Init_Proc);
  1445.    --  AKA
  1446.    --  N.B.: to be more precise, this uses a ncurses specific enhancement of
  1447.    --        ripoffline(), in which the Lines argument absolute value is the
  1448.    --        number of lines to be ripped of. The official ripoffline() only
  1449.    --        uses the sign of Lines to rip of a single line from bottom or top.
  1450.    pragma Inline (Rip_Off_Lines);
  1451.  
  1452.    type Cursor_Visibility is (Invisible, Normal, Very_Visible);
  1453.  
  1454.    --  ANCHOR(`curs_set()',`Set_Cursor_Visibility')
  1455.    procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
  1456.    --  AKA
  1457.    pragma Inline (Set_Cursor_Visibility);
  1458.  
  1459.    --  ANCHOR(`napms()',`Nap_Milli_Seconds')
  1460.    procedure Nap_Milli_Seconds (Ms : in Natural);
  1461.    --  AKA
  1462.    pragma Inline (Nap_Milli_Seconds);
  1463.  
  1464.    --  |=====================================================================
  1465.    --  | Some useful helpers.
  1466.    --  |=====================================================================
  1467.    type Transform_Direction is (From_Screen, To_Screen);
  1468.    procedure Transform_Coordinates
  1469.      (W      : in Window := Standard_Window;
  1470.       Line   : in out Line_Position;
  1471.       Column : in out Column_Position;
  1472.       Dir    : in Transform_Direction := From_Screen);
  1473.    --  This procedure transforms screen coordinates into coordinates relative
  1474.    --  to the window and vice versa, depending on the Dir parameter.
  1475.    --  Screen coordinates are the position informations on the physical device.
  1476.    --  An Curses_Exception will be raised if Line and Column are not in the
  1477.    --  Window or if you pass the Null_Window as argument.
  1478.    --  We don't inline this procedure
  1479.  
  1480.    --  MANPAGE(`dft_fgbg.3x')
  1481.  
  1482.    --  ANCHOR(`use_default_colors()',`Use_Default_Colors')
  1483.    procedure Use_Default_Colors;
  1484.    --  AKA
  1485.    pragma Inline (Use_Default_Colors);
  1486.  
  1487.    --  ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
  1488.    procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
  1489.                                     Back : Color_Number := Default_Color);
  1490.    --  AKA
  1491.    pragma Inline (Assume_Default_Colors);
  1492.  
  1493.    --  MANPAGE(`curs_extend.3x')
  1494.  
  1495.    --  ANCHOR(`curses_version()',`Curses_Version')
  1496.    function Curses_Version return String;
  1497.    --  AKA
  1498.  
  1499.    --  ANCHOR(`use_extended_names()',`Use_Extended_Names')
  1500.    --  The returnvalue is the previous setting of the flag
  1501.    function Use_Extended_Names (Enable : Boolean) return Boolean;
  1502.    --  AKA
  1503.  
  1504.    --  MANPAGE(`curs_scr_dump.3x')
  1505.  
  1506.    --  ANCHOR(`scr_dump()',`Screen_Dump_To_File')
  1507.    procedure Screen_Dump_To_File (Filename : in String);
  1508.    --  AKA
  1509.  
  1510.    --  ANCHOR(`scr_restore()',`Screen_Restore_From_File')
  1511.    procedure Screen_Restore_From_File (Filename : in String);
  1512.    --  AKA
  1513.  
  1514.    --  ANCHOR(`scr_init()',`Screen_Init_From_File')
  1515.    procedure Screen_Init_From_File (Filename : in String);
  1516.    --  AKA
  1517.  
  1518.    --  ANCHOR(`scr_set()',`Screen_Set_File')
  1519.    procedure Screen_Set_File (Filename : in String);
  1520.    --  AKA
  1521.  
  1522.    --  MANPAGE(`curs_print.3x')
  1523.    --  Not implemented:  mcprint
  1524.  
  1525.    --  MANPAGE(`curs_printw.3x')
  1526.    --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw,
  1527.    --                   vw_printw
  1528.    --  Please use the Ada style Text_IO child packages for formatted
  1529.    --  printing. It doesn't make a lot of sense to map the printf style
  1530.    --  C functions to Ada.
  1531.  
  1532.    --  MANPAGE(`curs_scanw.3x')
  1533.    --  Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
  1534.  
  1535.  
  1536.    --  MANPAGE(`resizeterm.3x')
  1537.    --  Not Implemented: resizeterm
  1538.  
  1539.    --  MANPAGE(`wresize.3x')
  1540.  
  1541.    --  ANCHOR(`wresize()',`Resize')
  1542.    procedure Resize (Win               : Window := Standard_Window;
  1543.                      Number_Of_Lines   : Line_Count;
  1544.                      Number_Of_Columns : Column_Count);
  1545.    --  AKA
  1546.  
  1547. private
  1548.    type Window is new System.Storage_Elements.Integer_Address;
  1549.    Null_Window : constant Window := 0;
  1550.  
  1551.    --  The next constants are generated and may be different on your
  1552.    --  architecture.
  1553.    --
  1554. include(`Window_Offsets')dnl
  1555.    Curses_Bool_False : constant Curses_Bool := 0;
  1556.  
  1557. end Terminal_Interface.Curses;
  1558.